<template>
  <div class="video video_box">
    <div class="video_box_player">
      <AliPlayerV3
        v-if="!stop"
        :source="options.source"
        ref="Aliplayer"
        :options="options"
        @liveStreamStop="liveStreamStop"
        @onM3u8Retry="onM3u8Retry"
      />
      <div
        class="ing_box"
        v-show="stop"
      >
        <img
          style="width: 100%"
          :src="options.cover"
        >
      </div>
      <p class="title font400 content3">
        {{ VideoData.title }}
      </p>
      <p
        class="text_tips"
        v-show="stop"
      >
        {{ text }}
      </p>
      <p
        class="text_tips"
        @click="lookLive"
        v-if="VideoData.sign_status == 0 && stare"
      >
        <span>观看课程</span>
      </p>
      <!-- <p class="count">
        <i class="iconfont iconnavbar_guanzhong" />
        &nbsp;{{
          VideoData.onclick
        }}
      </p> -->
      <div
        class="remind_time"
        v-if="VideoData.type == 1"
      >
        <div class="remind_time_size">
          <span class="distance">距开播时间 &nbsp;</span>
          <span
            class="day"
          >{{ day }}天 {{ hour }}时:{{ min }}分:{{ second }}秒</span>
          <span
            class="remind"
            style="background: #999"
            @click="SignUp"
            v-if="VideoData.is_sign == 1"
          >已预约</span>
          <span
            class="remind"
            @click="SignUp"
            v-else
          >开播提醒</span>
        </div>
      </div>
    </div>
    <div class="pub_tab curriculum">
      <van-tabs
        v-model:active="activeName"
        animated
        sticky
        :line-height="8"
        title-active-color="#12142E"
        title-inactive-color="#454757"
        color="#FF7A1F"
        background="#f7f7f7"
      >
        <van-tab title="互动">
          <ChatItem
            v-if="msgList.length > 0"
            :msglist="msgList"
            :userinfo="getToken('userId')"
          />
          <no-data v-else />
        </van-tab>
        <van-tab title="介绍">
          <div
            class="jieshao"
            v-if="VideoData != ''"
          >
            <div class="introduce_head">
              <p class="title color1 fontBold content3 line20">
                {{ VideoData.title }}
              </p>
              <p class="time font400 content2">
                <!-- 直播时间 : -->
                <!-- {{ moment.unix(VideoData.time).format("YYYY-MM-DD HH:mm:ss") }} -->
                {{ VideoData.time }}
              </p>
            </div>
            <div
              class="introduce_info"
              v-if="VideoData.desc"
            >
              <p class="flex align_center">
                <span class="line" />
                <span>课程介绍</span>
              </p>
              <p
                class="content color3 font400 content3 line20"
                v-html="VideoData.desc"
              />
            </div>
            <div
              class="introduce_info"
              v-if="VideoData.content"
            >
              <p class="flex align_center">
                <span class="line" />
                <span>课程内容</span>
              </p>
              <p
                class="content color3 font400 content3 line20"
                v-html="VideoData.content"
              />
            </div>
          </div>
          <no-data v-else />
        </van-tab>
        <van-tab title="课件">
          <div
            class="jieshao jieshao2"
            v-if="courseFile.file != ''"
          >
            <div class="file_box">
              <div
                class="file"
                v-for="(item, index) in courseFile.file"
                :key="index"
                @click="geturl(item.url)"
              >
                <a class="teld_btn btnColor">
                  <span class="content2 font400 color3">{{ item.name }}</span>
                  <i class="iconfont icon-dingdanzhongxin" />
                </a>
              </div>
            </div>
          </div>
          <no-data v-else />
        </van-tab>
      </van-tabs>
    </div>
    <van-row
      v-if="messageShow && activeName == 0"
      class="bottom"
    >
      <div class="s_text">
        <van-field
          class="message-field"
          placeholder="快来发言互动吧~健康直播文明互动，严禁发布涉政、违法、色情低俗等违规内容。"
          type="textarea"
          rows="1"
          v-model="sendValue"
          :clearable="false"
        />
        <div style="text-align: center">
          <div
            class="send_text"
            @click="onSearch"
          >
            发送
          </div>
          <div
            class="send_cancle"
            @click="messageShow = false"
          >
            取消
          </div>
        </div>
      </div>
    </van-row>
  </div>
  <div class="fexd_footer">
    <div class="footer_btn flex align_center justify_between">
      <div
        class="font400 content3 color4"
        @click="back"
      >
        <svg
          class="icon"
          aria-hidden="true"
        >
          <use xlink:href="#icon-fanhui" />
        </svg>
        <p class="content2 font400 color3">
          返回
        </p>
      </div>
      <div
        class="font400 content3 color4"
        @click="share"
      >
        <svg
          class="icon"
          aria-hidden="true"
        >
          <use xlink:href="#icon-fenxiang" />
        </svg>
        <p class="content2 font400 color3">
          分享
        </p>
      </div>
      <div
        v-if="VideoData.type == 2 && VideoData.is_sign == 1 && activeName != 0"
        @click="lookLive"
        class="agree font400 content3 color4"
      >
        观看直播
      </div>
      <div
        v-if="
          (VideoData.type == 3 || VideoData.type == 4) &&
            VideoData.is_sign == 1 &&
            activeName != 0
        "
        @click="playback"
        class="agree font400 content3 color4"
      >
        观看回放
      </div>
      <div
        v-if="VideoData.type == 5 && VideoData.is_sign == 1 && activeName != 0"
        class="agree font400 content3 color4"
      >
        已结束
      </div>
      <div
        v-if="VideoData.type == 1 && VideoData.is_sign == 1 && activeName != 0"
        class="agree font400 content3 color4"
      >
        已预约
      </div>
      <div
        @click="SignUp"
        class="agree font400 content3 color4"
        v-if="VideoData.is_sign == 0 && activeName != 0"
      >
        立即预约
      </div>
      <div
        @click="messageShow = true"
        class="agree font400 content3 color4"
        v-if="
          (VideoData.type == 1 ||
            VideoData.type == 2 ||
            VideoData.type == 3 ||
            VideoData.type == 4) &&
            activeName == 0
        "
      >
        立即留言
      </div>
    </div>
  </div>
  <Loading
    :visible="visible"
    :share-img="shareImg"
    @closeLoading="closeLoading"
  />
  <!-- 重复订单 -->
  <van-dialog
    v-model:show="orderStatus"
    width="90%"
    title="你有未完成的重复订单"
    confirm-button-text="继续预约"
    confirm-button-color="#FF7A1F"
    show-cancel-button
    @confirm="confirmOrder"
  >
    <div class="order">
      <div class="orderBox">
        <!-- <p class="fontBold color1 content4 title">
          你有未完成的重复订单
        </p>-->
        <div
          class="orderInfo"
          v-for="(item, index) in orderLists.list"
          :key="index"
        >
          <div class="orderInfoBox">
            <p class="line20">
              <van-tag
                style="height: 19px; width: 55px; justify-content: center"
                class="tagleft"
                color="#FF7A1F"
                type="primary"
              >
                审核中
              </van-tag>
              <span class="content3 fontBold color3">{{ item.title }}</span>
            </p>
            <p class="moeny flex align_center justify_between">
              <span class="content2 font400 color6">{{
                item.create_time
              }}</span>
              <span class="content3 font400 color1">￥{{ item.price }}</span>
            </p>
          </div>
          <div class="confin flex align_center justify_between">
            <div
              @click="cancle(item.id)"
              class="confinItem cancle font400 content2 color3"
            >
              取消订单
            </div>
            <div
              @click="see"
              class="confinItem see font400 content2 color2"
            >
              查看订单
            </div>
          </div>
        </div>
      </div>
    </div>
  </van-dialog>
</template>

<script setup lang="ts">
import moment from 'moment'
import { ref, defineAsyncComponent, onUnmounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
// import { useStore } from 'vuex'
import { AliPlayerV3 } from 'vue-aliplayer-v3'
import { getToken } from '@/service/cookie'
import { Toast } from 'vant'
import {
  courseDetail,
  courseGetFile,
  courseShowUrl,
  courseSignUp,
  courseShare,
  orderList,
  orderCancel
} from '@/api/index'
const NoData = defineAsyncComponent(
  () => import('@/components/NoData/index.vue')
)
const Loading = defineAsyncComponent(
  () => import('@/components/Loading/index.vue')
)
const ChatItem = defineAsyncComponent(
  () => import('@/components/ChatItem/index.vue')
)
const router = useRouter()
const route = useRoute()
// const store = useStore()
const activeName: any = ref(1)
const VideoData: any = ref([])
const courseFile: any = ref([])
const msgList: any = ref([1, 2, 3])
const ws: any = ref(null)
// const courCharge: any = ref([])
const stop: any = ref(false)
const visible: any = ref(false)
const endStatus: any = ref(false)
const messageShow: any = ref(false)
const stare: any = ref(false)
const btnShow: any = ref(true)
const shareImg: any = ref('')
const sendValue: any = ref('')
const day: any = ref('0')
const hour: any = ref('00')
const min: any = ref('00')
const second: any = ref('00')
const curStartTime: any = ref('')
const text: any = ref()
const stopStatus: any = ref()
const Cleartime: any = ref(null)
const Aliplayer: any = ref(null)
const orderLists: any = ref([])
const orderStatus: any = ref(false)
const options = ref({
  format: 'm3u8',
  source: '',
  isLive: true,
  cover: '',
  width: '100%',
  height: '210px',
  autoplay: true,
  rePlay: false,
  playsinline: true,
  preload: true,
  controlBarVisibility: 'alway',
  x5_type: 'h5', // 声明启用同层H5播放器，支持的值：h5
  vid: '',
  playauth: '',
  liveRetry: 5,
  skinLayout: []
})
// const userInfo = computed(() => {
//   return 1
// })

const confirmOrder = async () => {
  // confirm()
  try {
    orderStatus.value = false
    const res: any = await courseSignUp({ course_id: route.query.id })
    if (res.length === 0 || JSON.stringify(res) === '[]') {
      Toast('报名成功')
      getData()
    } else {
      router.push({
        path: '/userCenter/order',
        query: {
          pay_type: 3,
          pay_method: 0,
          paid_id: route.query.id,
          user_ids: JSON.stringify(res.user_ids)
        }
      })
    }
  } catch (error: any) {
    Toast(error.message)
    getData()
  }
}

const connect = async () => {
  const wsUrl = `${import.meta.env.VITE_API_WEBSCOKET}?course_id=${
    route.query.id
  }&token=${getToken('token')}`
  // 创建一个 websocket 连接
  ws.value = new WebSocket(wsUrl)
  // websocket 创建成功事件
  ws.value.onopen = onopen()
  // websocket 接收到消息事件
  ws.value.onmessage = onmessage
  ws.value.onerror = onerror()
}

const onopen = async () => {
  console.log('系统消息：建立连接成功')
}

const onmessage = async (e: any) => {
  const data = JSON.parse(e.data)
  console.log(data, 888)
  switch (data.type) {
    case 'handShake':
      // 发送用户登录
      sendMsg({ type: 'login' })
      break
    case 'login':
      messageListsAll(data.message_list)
      break
    case 'logout':
      break
    case 'message':
      messageLists(data)
      break
    case 'system':
      break
    case 'notice':
      noticeStatus(data)
      break
    case 'forbidden':
      noticeStatus(data)
      break
    case 'shield':
      shieldLsit(data)
      break
    case 'check_live':
      if (data.status === true) {
        location.reload()
      }
      break
    case 'live':
      break
  }
}

// const onclose = async () => {
//   ws.value.close()
// }

const onerror = async () => {
  console.log('系统消息 : 出错了,请退出重试.')
  // connect()
}

const sendMsg = async (msg: any) => {
  const data = JSON.stringify(msg)
  ws.value.send(data)
}

const messageLists = async (data: any) => {
  console.log(data, 11111)
  msgList.value.push(data)
}
const messageListsAll = async (data: any) => {
  console.log(data, 2222)
  msgList.value = data
}
const shieldLsit = async (data: any) => {
  console.log(data, 44444)
  data.shield_list.forEach((i: any, b: any) => {
    msgList.value.forEach((c: any, d: any) => {
      if (i === c.id) {
        msgList.value.splice(d, 1)
      }
    })
  })
}
const noticeStatus = async (data: any) => {
  console.log(data)
}
const oncloseWs = async (data: any) => {
  sendMsg({ type: 'logout', msg: '' })
  ws.value.close()
  console.log('连接关闭，定时重连')
}
connect()

// 报名
const SignUp = async () => {
  try {
    if (orderLists.value.list) {
      orderStatus.value = true
    } else {
      const res: any = await courseSignUp({ course_id: route.query.id })
      if (res.length === 0 || JSON.stringify(res) === '[]') {
        Toast('报名成功')
        getData()
      } else {
        router.push({
          path: '/userCenter/order',
          query: {
            pay_type: 3,
            pay_method: 0,
            paid_id: route.query.id,
            book_id: route.query.id,
            user_ids: JSON.stringify(res.user_ids)
          }
        })
      }
    }
  } catch (error: any) {
    Toast(error.message)
  }
}

const cancle = async (id: any) => {
  try {
    await orderCancel({ order_id: id })
    getData()
    Toast('取消成功')
  } catch (error: any) {
    Toast(error.message)
  }
}

const geturl = async (file: any) => {
  window.location.href = file
}

const see = async (id: any) => {
  router.push('/otherServices/order')
}

const getData = async () => {
  VideoData.value = await courseDetail({ course_id: route.query.id })
  options.value.cover = VideoData.value.dpic
  if (VideoData.value.down && VideoData.value.type === 1) {
    // this.curStartTime = moment.unix(this.VideoData.down).format("YYYY-MM-DD HH:mm:ss");
    curStartTime.value = moment
      .unix(VideoData.value.down)
      .format('YYYY-MM-DD HH:mm:ss')
    countTime()
  } else {
    clearTimeout(Cleartime.value)
  }
  // courCharge.value = await getCharge({ course_id: route.query.id })
  const res: any = await courseShowUrl({ course_id: route.query.id })
  courseFile.value = await courseGetFile({ course_id: route.query.id })
  console.log(res.type, 999)
  if (res.type === 2) {
    options.value.source = res.show_url
    options.value.skinLayout = [
      {
        name: 'bigPlayButton',
        align: 'cc',
        x: 30,
        y: 80
      },
      {
        name: 'H5Loading',
        align: 'cc'
      },
      {
        name: 'infoDisplay'
      },
      {
        name: 'tooltip',
        align: 'blabs',
        x: 0,
        y: 56
      },
      {
        name: 'thumbnail'
      },
      {
        name: 'controlBar',
        align: 'blabs',
        x: 0,
        y: 0,
        children: [
          {
            name: 'fullScreenButton',
            align: 'tr',
            x: 10,
            y: 12
          },
          {
            name: 'volume',
            align: 'tr',
            x: 5,
            y: 10
          }
        ]
      }
    ]
  } else if (res.type === 3) {
    if (res.show_url === '') {
      text.value = '回放生成中，请稍候~'
      stop.value = true
    } else {
      options.value.vid = res.vid
      options.value.playauth = res.PlayAuth
      options.value.format = ''
      options.value.isLive = false
      options.value.skinLayout = [
        {
          name: 'bigPlayButton',
          align: 'cc',
          x: 30,
          y: 80
        },
        {
          name: 'H5Loading',
          align: 'cc'
        },
        {
          name: 'tooltip',
          align: 'blabs',
          x: 0,
          y: 56
        },
        {
          name: 'thumbnail'
        },
        {
          name: 'controlBar',
          align: 'blabs',
          x: 0,
          y: 0,
          children: [
            {
              name: 'progress',
              align: 'blabs',
              x: 0,
              y: 44
            },
            {
              name: 'playButton',
              align: 'tl',
              x: 15,
              y: 12
            },
            {
              name: 'timeDisplay',
              align: 'tl',
              x: 10,
              y: 7
            },
            {
              name: 'fullScreenButton',
              align: 'tr',
              x: 10,
              y: 12
            },
            {
              name: 'volume',
              align: 'tr',
              x: 5,
              y: 10
            }
          ]
        }
      ]
    }
  } else if (res.type === 4) {
    options.value.source = res.show_url
    options.value.format = ''
    options.value.isLive = false
    options.value.skinLayout = [
      {
        name: 'bigPlayButton',
        align: 'cc',
        x: 30,
        y: 80
      },
      {
        name: 'H5Loading',
        align: 'cc'
      },
      {
        name: 'tooltip',
        align: 'blabs',
        x: 0,
        y: 56
      },
      {
        name: 'thumbnail'
      },
      {
        name: 'controlBar',
        align: 'blabs',
        x: 0,
        y: 0,
        children: [
          {
            name: 'progress',
            align: 'blabs',
            x: 0,
            y: 44
          },
          {
            name: 'playButton',
            align: 'tl',
            x: 15,
            y: 12
          },
          {
            name: 'timeDisplay',
            align: 'tl',
            x: 10,
            y: 7
          },
          {
            name: 'fullScreenButton',
            align: 'tr',
            x: 10,
            y: 12
          },
          {
            name: 'volume',
            align: 'tr',
            x: 5,
            y: 10
          }
        ]
      }
    ]
  }
  orderLists.value = await orderList({
    pay_type: 3,
    type: 1,
    paid_id: route.query.id
  })
}
getData()

// 倒计时
const countTime = () => {
  // 获取当前时间
  const date = new Date()
  const now = date.getTime()
  // 设置截止时间
  const endDate = new Date(curStartTime.value.replace(/-/g, '/')) // this.curStartTime需要倒计时的日期
  const end = endDate.getTime()
  // 时间差
  const leftTime = end - now
  // 定义变量 d,h,m,s保存倒计时的时间
  if (leftTime >= 0) {
    // 天
    day.value = Math.floor(leftTime / 1000 / 60 / 60 / 24)
    // 时
    const h: any = Math.floor((leftTime / 1000 / 60 / 60) % 24)
    hour.value = h < 10 ? '0' + h : h
    // 分
    const m: any = Math.floor((leftTime / 1000 / 60) % 60)
    min.value = m < 10 ? '0' + m : m
    // 秒
    const s: any = Math.floor((leftTime / 1000) % 60)
    second.value = s < 10 ? '0' + s : s
  } else {
    day.value = 0
    hour.value = '00'
    min.value = '00'
    second.value = '00'
  }
  // 等于0的时候不调用
  if (
    Number(hour.value) === 0 &&
    Number(day.value) === 0 &&
    Number(min.value) === 0 &&
    Number(second.value) === 0
  ) {
    console.log('取消')
  } else {
    // 递归每秒调用countTime方法，显示动态时间效果,
    Cleartime.value = setTimeout(countTime, 1000)
  }
}

// 播放器断流
const liveStreamStop = () => {
  if (endStatus.value) {
    stop.value = true
    text.value = '直播结束了~'
    options.value.source = ''
  }
}

const onM3u8Retry = () => {
  stopStatus.value = true
  if (stopStatus.value) {
    stop.value = true
    // than.player.pause();
    getData()
    stop.value = false
    text.value = '直播暂停中，请稍候~'
    console.log('主播暂时离开，请稍后......')
  }
}

const back = () => {
  // if (store.state.from.path === '/userCenter/order') {
  //   router.replace({ path: '/find', query: { f: 1 } })
  // } else if (store.state.from.path !== '/') {
  //   router.back()
  // }
  router.replace({ path: '/find', query: { f: 1 } })
  // if (store.state.from.path !== '/') {
  // } else {
  //   router.replace('/')
  // }
}

const closeLoading = async () => {
  visible.value = false
}

const share = async () => {
  try {
    visible.value = true
    await courseShare({
      course_id: route.query.id,
      web_url: encodeURIComponent(window.location.href)
    })
    shareImg.value = `${
      import.meta.env.VITE_API_BASEURL
    }v1/find_course/share?course_id=${
      route.query.id
    }&web_url=${encodeURIComponent(window.location.href)}`
  } catch (error: any) {
    Toast(error.message)
  }
}

// const goVideo = (id:any) => {
//   console.log(111)
// }

// 直播回放
const playback = async () => {
  if (VideoData.value.is_sign === 1) {
    btnShow.value = false
    options.value.isLive = false
    getData()
    // Aliplayer.value.play()
    stare.value = false
  } else {
    await SignUp()
    await getData()
  }
}

// // 观看直播
const lookLive = async () => {
  if (VideoData.value.is_sign === 1) {
    btnShow.value = false
    options.value.isLive = true
    getData()
    stare.value = false
  } else {
    await SignUp()
    await getData()
  }
}

// 发送信息
const onSearch = () => {
  const val = { type: 'message', msg: sendValue.value }
  sendMsg(val)
  sendValue.value = ''
  messageShow.value = false
}

onUnmounted(() => {
  console.log('清除websocket')
  // Aliplayer.value.dispose()
  oncloseWs()
  clearTimeout(Cleartime.value)
})
</script>

<style lang="less" scoped>
.news {
  padding: 30px 15px 80px;
  .news_head {
    margin-bottom: 20px;
    div {
      margin-top: 15px;
    }
  }
  .news_content {
    line-height: 25px;
  }
}
.fexd_footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: #fff;
  box-shadow: 0px 2px 12px 2px rgba(22, 12, 6, 0.09);
  .footer_btn {
    padding: 0 30px;
    height: 100%;
    text-align: center;
    .agree {
      width: 189px;
      height: 44px;
      background: #ff7a1f;
      border-radius: 5px;
      text-align: center;
      line-height: 44px;
    }
    .icon {
      width: 23px;
      height: 23px;
      margin-bottom: 2px;
    }
  }
}
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  .block {
    width: 200px;
    height: 50px;
    background: #ffffff;
    border: 1px solid #eef1f7;
    box-shadow: 0px 0px 8px 0px rgba(22, 12, 6, 0.1);
    border-radius: 10px;
    .icon {
      width: 24px;
      height: 24px;
      margin-right: 4px;
    }
    p {
      line-height: 27px;
      height: 27px;
      margin-top: 6px;
    }
  }
}

.tourist {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  .tourist_s {
    text-align: center;
    background: #fff;
    padding: 20px;
    p {
      margin: 5px 0;
    }
  }
  img {
    display: block;
    width: 90%;
    margin: 0 auto;
  }
  .reg {
    width: 177px;
    height: 39px;
    background: #e52829;
    border-radius: 39px;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    line-height: 39px;
    text-align: center;
    margin: 0 auto;
    position: absolute;
    bottom: 7%;
    left: 50%;
    transform: translateX(-50%);
  }
  .register_clone {
    position: initial;
    top: 0;
    margin-top: 20px;
    width: 35px !important;
    height: 35px;
    z-index: 99999999999999;
  }
}
.count {
  margin: 0;
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 999;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 12px;
  .iconfont {
    font-size: 12px;
  }
}
.ing_box {
  width: 100%;
  height: 210px;
  position: relative;
  // background:rgba(0, 0, 0, 0.5);
  img {
    width: 100%;
    height: 210px;
    object-fit: cover;
  }
}

.s_text {
  width: 95%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  .send_text {
    font-size: 15px;
    font-weight: bold;
    color: #d20022;
    margin-right: 15px;
    padding: 5px;
  }
  .send_cancle {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-right: 15px;
    margin-top: 50px;
  }
}
.message-field {
  // margin: 7px 4px;
  padding: 6px;
  font-size: 13px;
  width: 75%;
  height: 120px;
  background: #f5f6f8;
  border-radius: 5px;
  margin: 5px 0 15px 6px;
}
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  z-index: 22;
}
.lodinfix {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
}
.yy {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999 !important;
  background: rgba(0, 0, 0, 0.5);
}
.jt {
  width: 100%;
  height: 70%;
  position: fixed;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    // border-radius: 15px;
  }
}
.close {
  width: 35px;
  height: 35px;
  position: fixed;
  bottom: -26%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  img {
    // transform: scale(.25);
    width: 100%;
  }
}
.HB_TS {
  width: 55vw;
  color: #fff;
  text-align: center;
  font-size: 3vw;
  position: absolute;
  bottom: -12%;
  z-index: 999999999999999;
  left: 50%;
  transform: translateX(-50%);
}
// @import "swiper/dist/css/swiper.css";

.video {
  padding-top: 0 !important;
  overflow: hidden;
  height: 100vh;
}
.dpic {
  padding-bottom: 56%;
  width: 100%;
  position: relative;
  img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
  }
}
.docking_footer {
  width: 100%;
  height: 60px;
  background: #ffffff;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  div {
    text-align: center;
  }
  .text {
    font-size: 13px;
    font-weight: bold;
    color: #595959;
    text-align: center;
    margin-top: 5px;
  }
  .icon {
    margin-bottom: 0;
    .iconfenxiang1-01 {
      font-size: 19px;
    }
  }
  .request-btn {
    width: 200px;
    height: 34px;
    line-height: 34px;
    border-radius: 17px;
  }
}
.video_content {
  width: 90%;
  margin: 20px auto;
  background-color: #fff;
  border-radius: 10px;
  .video_content_item {
    padding: 10px 15px;
  }
}
.video_box_player {
  position: relative;
  .title {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    width: 100%;
    height: 40px;
    line-height: 40px;
    z-index: 12;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding-left: 15px;
  }
  .video_p {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
    color: #ffffff;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    width: 100%;
    height: 40px;
    z-index: 11;
    .video_title {
      font-size: 12px;
      font-weight: 400;
      padding: 0 15px;
    }
  }

  .remind_time {
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0;
    width: 100%;
    height: 40px;
    z-index: 12;
    background: rgba(0, 0, 0, 0.3);
    .remind_time_size {
      margin-left: 15px;
      margin-top: 12px;
    }
    .distance {
      font-size: 12px;
      font-weight: 400;
      color: #ffffff;
    }
    .day {
      font-size: 12px;
      font-weight: 400;
      color: #ffbb10;
    }
    .remind {
      width: 64px;
      height: 20px;
      background: #ff652f;
      border-radius: 10px;
      font-size: 12px;
      font-weight: 400;
      color: #fff;
      display: inline-block;
      text-align: center;
      line-height: 21px;
      margin-left: 8px;
    }
  }
}
.docking_info {
  width: 90%;
  margin: 0 auto 20px;
  border-radius: 5px;
  background-color: #fff;
  display: block;
  .name {
    font-size: 12px;
    font-weight: bold;
    color: #333;
  }
  .desc {
    font-size: 13px;
    font-weight: 400;
    color: #464855;
    line-height: 1.5;
    word-break: break-word;
  }
  .time {
    font-size: 12px;
    font-weight: 400;
    color: #464855;
    opacity: 0.6;
  }
}
.jieshao {
  background: #fff;
  width: 314px;
  margin: 10px auto;
  border-radius: 5px;
  padding: 15px;
  overflow: auto;
  height: calc(100vh - 380px);
  .content {
    ::v-deep hr,
    ::v-deep img,
    ::v-deep table {
      width: 100% !important;
      object-fit: contain;
      margin: auto !important;
    }
  }
  .introduce_head {
    padding-bottom: 15px;
    border-bottom: 1px solid #cacaca;
    .title {
    }
    .time {
      background: #fce9db;
      border-radius: 5px;
      color: #ee762a;
      display: inline-block;
      padding: 5px 10px;
      margin-top: 15px;
    }
  }
  .introduce_info {
    margin-top: 15px;
    padding-bottom: 20px;
    p {
      .line {
        display: inline-block;
        width: 3px;
        height: 16px;
        background: #ee762a;
        vertical-align: text-top;
        margin-right: 7px;
      }
    }
    .content {
      margin-top: 15px;
      word-break: break-all;
      img {
        width: 100%;
      }
    }
  }
}
// .jieshao2{
//   height: auto;
// }

.file {
  width: 100%;
  height: 62px;
  background: #f6f6f6;
  border-radius: 5px;
  position: relative;
  margin-bottom: 10px;
  span {
    padding-left: 15px;
    position: relative;
    top: 10px;
    display: inline-block;
    width: 160px;
    word-break: break-all;
  }
  .iconfont {
    font-size: 29px;
    position: absolute;
    right: 13px;
    top: 50%;
    color: #d9d9d9;
    transform: translateY(-50%);
  }
}
.flex-r {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
  padding: 0;
}
.flex-l {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.text_tips {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  z-index: 11;
  span {
    border: 1px solid #fff;
    padding: 8px 30px;
    border-radius: 50px;
  }
}

.order {
  // width: 315px;
  // height: 308px;
  // background: #ffffff;
  // box-shadow: 0px 0px 7px 0px rgba(22, 12, 6, 0.1);
  // border-radius: 10px;
  .orderBox {
    padding: 15px;
    height: 200px;
    overflow: auto;
    .title {
      text-align: center;
    }
    .orderInfo {
      // width: 286px;
      background: #f7f7f7;
      border-radius: 5px;
      margin-top: 20px;
      .orderInfoBox {
        padding: 15px;
        .tagleft {
          margin-right: 5px;
        }
        .moeny {
          margin-top: 20px;
        }
      }
    }
  }
  .confin {
    border-top: 1px solid #cacaca;
    .confinItem {
      width: 50%;
      text-align: center;
      height: 48px;
      line-height: 48px;
      border-right: 1px solid #cacaca;
    }
    .confinItem:last-child {
      border-right: 0;
    }
  }
}
@media (min-width: 750px) {
  .news {
    padding: 30px 15px 80px;
    .news_head {
      margin-bottom: 20px;
      div {
        margin-top: 15px;
      }
    }
    .news_content {
      line-height: 25px;
    }
  }
  .fexd_footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #fff;
    box-shadow: 0px 2px 12px 2px rgba(22, 12, 6, 0.09);
    .footer_btn {
      padding: 0 30px;
      height: 100%;
      text-align: center;
      .agree {
        width: 189px;
        height: 44px;
        background: #ff7a1f;
        border-radius: 5px;
        text-align: center;
        line-height: 44px;
      }
      .icon {
        width: 23px;
        height: 23px;
        margin-bottom: 2px;
      }
    }
  }
  .wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    .block {
      width: 200px;
      height: 50px;
      background: #ffffff;
      border: 1px solid #eef1f7;
      box-shadow: 0px 0px 8px 0px rgba(22, 12, 6, 0.1);
      border-radius: 10px;
      .icon {
        width: 24px;
        height: 24px;
        margin-right: 4px;
      }
      p {
        line-height: 27px;
        height: 27px;
        margin-top: 6px;
      }
    }
  }

  .tourist {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    .tourist_s {
      text-align: center;
      background: #fff;
      padding: 20px;
      p {
        margin: 5px 0;
      }
    }
    img {
      display: block;
      width: 90%;
      margin: 0 auto;
    }
    .reg {
      width: 177px;
      height: 39px;
      background: #e52829;
      border-radius: 39px;
      font-size: 18px;
      font-weight: 500;
      color: #ffffff;
      line-height: 39px;
      text-align: center;
      margin: 0 auto;
      position: absolute;
      bottom: 7%;
      left: 50%;
      transform: translateX(-50%);
    }
    .register_clone {
      position: initial;
      top: 0;
      margin-top: 20px;
      width: 35px !important;
      height: 35px;
      z-index: 99999999999999;
    }
  }
  .count {
    margin: 0;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 12px;
    .iconfont {
      font-size: 12px;
    }
  }
  .ing_box {
    width: 100%;
    height: 210px;
    position: relative;
    // background:rgba(0, 0, 0, 0.5);
    img {
      width: 100%;
      height: 210px;
      object-fit: cover;
    }
  }

  .s_text {
    width: 95%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    .send_text {
      font-size: 15px;
      font-weight: bold;
      color: #d20022;
      margin-right: 15px;
      padding: 5px;
    }
    .send_cancle {
      font-size: 14px;
      font-weight: bold;
      color: #666;
      margin-right: 15px;
      margin-top: 50px;
    }
  }
  .message-field {
    // margin: 7px 4px;
    padding: 6px;
    font-size: 13px;
    width: 75%;
    height: 120px;
    background: #f5f6f8;
    border-radius: 5px;
    margin: 5px 0 15px 6px;
  }
  .bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    z-index: 22;
  }
  .lodinfix {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
  }
  .yy {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.5);
  }
  .jt {
    width: 100%;
    height: 70%;
    position: fixed;
    top: 43%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      // border-radius: 15px;
    }
  }
  .close {
    width: 35px;
    height: 35px;
    position: fixed;
    bottom: -26%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    img {
      // transform: scale(.25);
      width: 100%;
    }
  }
  .HB_TS {
    width: 55vw;
    color: #fff;
    text-align: center;
    font-size: 3vw;
    position: absolute;
    bottom: -12%;
    z-index: 999999999999999;
    left: 50%;
    transform: translateX(-50%);
  }
  // @import "swiper/dist/css/swiper.css";

  .video {
    padding-top: 0 !important;
    overflow: hidden;
    height: 100vh;
  }
  .dpic {
    padding-bottom: 56%;
    width: 100%;
    position: relative;
    img {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
    }
  }
  .docking_footer {
    width: 100%;
    height: 60px;
    background: #ffffff;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    div {
      text-align: center;
    }
    .text {
      font-size: 13px;
      font-weight: bold;
      color: #595959;
      text-align: center;
      margin-top: 5px;
    }
    .icon {
      margin-bottom: 0;
      .iconfenxiang1-01 {
        font-size: 19px;
      }
    }
    .request-btn {
      width: 200px;
      height: 34px;
      line-height: 34px;
      border-radius: 17px;
    }
  }
  .video_content {
    width: 90%;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 10px;
    .video_content_item {
      padding: 10px 15px;
    }
  }
  .video_box_player {
    position: relative;
    .title {
      position: absolute;
      top: 0;
      left: 0;
      margin: 0;
      width: 100%;
      height: 40px;
      line-height: 40px;
      z-index: 12;
      color: #fff;
      background: rgba(0, 0, 0, 0.3);
      padding-left: 15px;
    }
    .video_p {
      background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
      color: #ffffff;
      position: absolute;
      top: 0;
      left: 0;
      margin: 0;
      width: 100%;
      height: 40px;
      z-index: 11;
      .video_title {
        font-size: 12px;
        font-weight: 400;
        padding: 0 15px;
      }
    }

    .remind_time {
      position: absolute;
      bottom: 0;
      left: 0;
      margin: 0;
      width: 100%;
      height: 40px;
      z-index: 12;
      background: rgba(0, 0, 0, 0.3);
      .remind_time_size {
        margin-left: 15px;
        margin-top: 12px;
      }
      .distance {
        font-size: 12px;
        font-weight: 400;
        color: #ffffff;
      }
      .day {
        font-size: 12px;
        font-weight: 400;
        color: #ffbb10;
      }
      .remind {
        width: 64px;
        height: 20px;
        background: #ff652f;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 400;
        color: #fff;
        display: inline-block;
        text-align: center;
        line-height: 21px;
        margin-left: 8px;
      }
    }
  }
  .docking_info {
    width: 90%;
    margin: 0 auto 20px;
    border-radius: 5px;
    background-color: #fff;
    display: block;
    .name {
      font-size: 12px;
      font-weight: bold;
      color: #333;
    }
    .desc {
      font-size: 13px;
      font-weight: 400;
      color: #464855;
      line-height: 1.5;
      word-break: break-word;
    }
    .time {
      font-size: 12px;
      font-weight: 400;
      color: #464855;
      opacity: 0.6;
    }
  }
  .jieshao {
    background: #fff;
    width: 314px;
    margin: 10px auto;
    border-radius: 5px;
    padding: 15px;
    overflow: auto;
    height: calc(100vh - 380px);
    .content {
      ::v-deep hr,
      ::v-deep img,
      ::v-deep table {
        width: 100% !important;
        object-fit: contain;
        margin: auto !important;
      }
    }
    .introduce_head {
      padding-bottom: 15px;
      border-bottom: 1px solid #cacaca;
      .title {
      }
      .time {
        background: #fce9db;
        border-radius: 5px;
        color: #ee762a;
        display: inline-block;
        padding: 5px 10px;
        margin-top: 15px;
      }
    }
    .introduce_info {
      margin-top: 15px;
      padding-bottom: 20px;
      p {
        .line {
          display: inline-block;
          width: 3px;
          height: 16px;
          background: #ee762a;
          vertical-align: text-top;
          margin-right: 7px;
        }
      }
      .content {
        margin-top: 15px;
        word-break: break-all;
        img {
          width: 100%;
        }
      }
    }
  }
  // .jieshao2{
  //   height: auto;
  // }

  .file {
    width: 100%;
    height: 62px;
    background: #f6f6f6;
    border-radius: 5px;
    position: relative;
    margin-bottom: 10px;
    span {
      padding-left: 15px;
      position: relative;
      top: 10px;
      display: inline-block;
      width: 160px;
      word-break: break-all;
    }
    .iconfont {
      font-size: 29px;
      position: absolute;
      right: 13px;
      top: 50%;
      color: #d9d9d9;
      transform: translateY(-50%);
    }
  }
  .flex-r {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 0;
  }
  .flex-l {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
  }

  .text_tips {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 11;
    span {
      border: 1px solid #fff;
      padding: 8px 30px;
      border-radius: 50px;
    }
  }

  .order {
    // width: 315px;
    // height: 308px;
    // background: #ffffff;
    // box-shadow: 0px 0px 7px 0px rgba(22, 12, 6, 0.1);
    // border-radius: 10px;
    .orderBox {
      padding: 15px;
      height: 200px;
      overflow: auto;
      .title {
        text-align: center;
      }
      .orderInfo {
        // width: 286px;
        background: #f7f7f7;
        border-radius: 5px;
        margin-top: 20px;
        .orderInfoBox {
          padding: 15px;
          .tagleft {
            margin-right: 5px;
          }
          .moeny {
            margin-top: 20px;
          }
        }
      }
    }
    .confin {
      border-top: 1px solid #cacaca;
      .confinItem {
        width: 50%;
        text-align: center;
        height: 48px;
        line-height: 48px;
        border-right: 1px solid #cacaca;
      }
      .confinItem:last-child {
        border-right: 0;
      }
    }
  }
}
</style>
